<template>
  <div id="app">
    <v-header :seller="seller"/>
    <div class="tab border-1px">

      <div class="tab-item">
        <router-link to="/goods">商品</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/ratings">排名</router-link>
      </div>
      <div class="tab-item">
        <router-link to="/seller">商家</router-link>
      </div>

    </div>

    <router-view/>
  </div>
</template>

<!-- script -->
<script>
  import header from './components/header/hearder'
  const  err_ok = 0

  export default {
    name: 'App',

    data() {
      return {
        seller : {}
      }
    },

    components: {
      'v-header': header
    },

    created() {
      // seller
      this.$http.get('/api/seller').then( (res) => {
        let body =  res.body
        if (body.errno === err_ok) {
          this.seller = body.data
          console.log(body)
          console.log(body.data.name)
        }
      })
    }
  }
</script>

<style lang="stylus" rel="stylesheet/stylus">
  @import "./common/mixin.styl"
  .tab
    display: flex
    width: 100%
    height:40px
    line-height : 40px
    border-1px(rgba(198,180,200,0.2))
    .tab-item
      flex: 1
      text-align: center
      &>a
        display : block
        text-decoration : none
        font-size : 14px
        color = rgb(77,85,93)
        &.active
          color: red


</style>
